package com.asohofrucol.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * The persistent class for the a_user database table.
 * 
 */
@Entity
@Table(name = "a_user")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	@Column(name = "first_last_name")
	private String firstLastName;

	@Column(name = "first_name")
	private String firstName;

	private int profile;

	@Column(name = "second_last_name")
	private String secondLastName;

	@Column(name = "second_name")
	private String secondName;

	@Column(name = "status")
	private int status;

	@Column(name = "username")
	private String username;

	// bi-directional many-to-one association to APassword
	// este es el nombre tal como está el atributo en la otra clase
	// Lazy Fetch vs Eager Fetch para este caso : Eager Fetch
	@OneToMany(fetch = FetchType.EAGER, mappedBy = "user")
	private List<Password> passwords;

	public User() {
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getFirstLastName() {
		return this.firstLastName;
	}

	public void setFirstLastName(String firstLastName) {
		this.firstLastName = firstLastName;
	}

	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public int getProfile() {
		return this.profile;
	}

	public void setProfile(int profile) {
		this.profile = profile;
	}

	public String getSecondLastName() {
		return this.secondLastName;
	}

	public void setSecondLastName(String secondLastName) {
		this.secondLastName = secondLastName;
	}

	public String getSecondName() {
		return this.secondName;
	}

	public void setSecondName(String secondName) {
		this.secondName = secondName;
	}

	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public List<Password> getPasswords() {
		return this.passwords;
	}

	public void setPasswords(List<Password> Passwords) {
		this.passwords = Passwords;
	}

}